package com.zxn.ssyx.controller;

import com.zxn.ssyx.common.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/admin/acl/index")
@CrossOrigin  //跨域
@Api(tags = "后台登录管理")
public class IndexController {

    /**
     * 1、请求登录接口
     * @return
     */
    @PostMapping("/login")
    public Result login(){
        Map<String,Object> map = new HashMap<>();
        map.put("token","admin-token");
        return Result.ok(map);
    }

    /**
     * 2、获取用户信息接口
     * @return
     */
    @GetMapping("/info")
    public Result userInfo(){
        Map<String,Object> map = new HashMap<>();
        map.put("name","zxn");
        map.put("avatar","https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
        return Result.ok(map);
    }

    /**
     * 3、退出登录接口
     * @return
     */
    @PostMapping("/logout")
    public Result logout(){
        return Result.ok("退出成功！！");
    }
}
